How to Create Dataset using Server Script
What is Server Script?
- Server-side scripting is involves employing scripts on a server which produces a response customized for each user's request to the website.
I. Create Dataset using Server Script :-
Follow this procedure to create dataset. (Note: Follow the steps till No. 4 for this example)
Update the Details as given below:
- Name: ss_table
- Datasource: Empty Dataset
- Server Script: Check the checkbox
- Language: Select Python3 from the drop-down list.
- Go to Server Script Tab & paste your script. (For this example, you can use refer note)
Note:
dict = {"country": ["Brazil", "Russia", "India", "China", "South Africa"],
"capital": ["Brasilia", "Moscow", "New Dehli", "Beijing", "Pretoria"],
"area": [8.516, 17.10, 3.286, 9.597, 1.221],
"population": [200.4, 143.5, 1252, 1357, 52.98] }
import pandas as pd
brics = pd.DataFrame(dict)
data = {'data':brics.to_json(orient = 'records')};
display(data);
Click on preview button & your window will look as per image below:
Click on Submit button to create dataset.